<?php
$sql_query=mysql_query("SELECT joke,date,score FROM ".DATABASE_TABLE_JOKE." ORDER BY date DESC LIMIT 30");
	

print '<?xml version="1.0" encoding= "ISO-8859-1"?>';
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Bodji's Jokes</title>
		<link><?php print "http://".$_SERVER["SERVER_NAME"]."".$_SERVER['PHP_SELF']; ?></link>
		<description>The last jokes of Bodji</description>
		<language>fr</language> 
		<?php
		while ($query = mysql_fetch_array($sql_query) ){
		?>
		
		<item>
		      <title><?php print stripslashes(htmlspecialchars(substr($query['joke'],0,50)))."..."; ?></title>
		      <link><?php print "http://".$_SERVER["SERVER_NAME"]."".$_SERVER['PHP_SELF'] ?></link>
		      <description><?php print date("d M y",$query['date']);?> score <?php print $query['score']; ?></description>
		      <pubDate><?php print date("d M y",$query['date']);?></pubDate>
		</item>
		<?php
		 }
		 ?>
		 
	</channel>
</rss> 